home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / STORAGE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-03  |  5.4 KB  |  160 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/src/microcode/RCS/storage.c,v 9.48 1992/02/03 23:39:19 jinx Exp $
  4.  
  5. Copyright (c) 1987-1992 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. /* This file defines the storage for the interpreter's global variables. */
  36.  
  37. #include "scheme.h"
  38. #include "gctype.c"
  39.  
  40.                          /*************/
  41.                          /* REGISTERS */
  42.                          /*************/
  43.  
  44. SCHEME_OBJECT
  45.  * Ext_History,        /* History register */
  46.  * Free,        /* Next free word in storage */
  47.  * MemTop,        /* Top of free space available */
  48.  * Ext_Stack_Pointer,    /* Next available slot in control stack */
  49.  * Stack_Top,        /* Top of control stack */
  50.  * Stack_Guard,        /* Guard area at end of stack */
  51.  * Free_Stacklets,    /* Free list of stacklets */
  52.  * Constant_Space,    /* Bottom of constant+pure space */
  53.  * Free_Constant,    /* Next free cell in constant+pure area */
  54.  * Constant_Top,    /* Top of constant+pure space */
  55.  * Heap_Top,        /* Top of current heap */
  56.  * Heap_Bottom,        /* Bottom of current heap */
  57.  * Unused_Heap_Top,    /* Top of other heap */
  58.  * Unused_Heap,        /* Bottom of other heap */
  59.  * Local_Heap_Base,    /* Per-processor CONSing area */
  60.  * Heap,        /* Bottom of entire heap */
  61.    Current_State_Point,    /* Used by dynamic winder */
  62.    Fluid_Bindings,    /* Fluid bindings AList */
  63.  * last_return_code;    /* Address of the most recent return code in the stack.
  64.                This is only meaningful while in compiled code.
  65.                *** This must be changed when stacklets are used. */
  66.  
  67. long
  68.   IntCode,        /* Interrupts requesting */
  69.   IntEnb,        /* Interrupts enabled */
  70.   temp_long,        /* temporary for sign extension */
  71.   GC_Reserve,        /* Scheme pointer overflow space in heap */
  72.   GC_Space_Needed;    /* Amount of space needed when GC triggered */
  73.  
  74. Declare_Fixed_Objects ();
  75.  
  76. Boolean Trapping;
  77.  
  78. SCHEME_OBJECT Old_Return_Code;
  79. SCHEME_OBJECT * Return_Hook_Address;
  80.  
  81. SCHEME_OBJECT * Prev_Restore_History_Stacklet;
  82. long Prev_Restore_History_Offset;
  83.  
  84. long Heap_Size;
  85. long Constant_Size;
  86. long Stack_Size;
  87. SCHEME_OBJECT * Highest_Allocated_Address;
  88. #ifndef HEAP_IN_LOW_MEMORY
  89. SCHEME_OBJECT * memory_base;
  90. #endif
  91.  
  92.                     /**********************/
  93.                     /* DEBUGGING SWITCHES */
  94.                     /**********************/
  95.  
  96. #ifdef ENABLE_DEBUGGING_TOOLS
  97.  
  98. Boolean Eval_Debug    = false;
  99. Boolean Hex_Input_Debug    = false;
  100. Boolean File_Load_Debug    = false;
  101. Boolean Reloc_Debug    = false;
  102. Boolean Intern_Debug    = false;
  103. Boolean Cont_Debug    = false;
  104. Boolean Primitive_Debug    = false;
  105. Boolean Lookup_Debug    = false;
  106. Boolean Define_Debug    = false;
  107. Boolean GC_Debug    = false;
  108. Boolean Upgrade_Debug    = false;
  109. Boolean Dump_Debug    = false;
  110. Boolean Trace_On_Error    = false;
  111. Boolean Bignum_Debug    = false;
  112. Boolean Per_File    = true;
  113. Boolean Fluids_Debug    = false;
  114. More_Debug_Flag_Allocs();
  115.  
  116. int debug_slotno = 0;
  117. int debug_nslots = 0;
  118. int local_slotno = 0;
  119. int local_nslots = 0;
  120.  
  121. #if FALSE /* MHWU */
  122. int debug_circle[debug_maxslots];
  123. int local_circle[debug_maxslots];
  124. #endif /* false */
  125.  
  126. int debug_circle[100];
  127. int local_circle[100];
  128. #endif /* ENABLE_DEBUGGING_TOOLS */
  129.  
  130.         /****************************/
  131.         /* Debugging Macro Messages */
  132.         /****************************/
  133.  
  134. char *CONT_PRINT_RETURN_MESSAGE =   "Save_Cont, return code";
  135. char *CONT_PRINT_EXPR_MESSAGE   =   "Save_Cont, expression";
  136. char *RESTORE_CONT_RETURN_MESSAGE = "Restore_Cont, return code";
  137. char *RESTORE_CONT_EXPR_MESSAGE =   "Restore_Cont, expression";
  138.  
  139. /* Interpreter code name and message tables */
  140.  
  141. long MAX_RETURN = MAX_RETURN_CODE;
  142.  
  143. extern char *Return_Names[];
  144. char *Return_Names[] = RETURN_NAME_TABLE;    /* in returns.h */
  145.  
  146. extern char *Type_Names[];
  147. char *Type_Names[] = TYPE_NAME_TABLE;        /* in types.h */
  148.  
  149. extern char *Abort_Names[];
  150. char *Abort_Names[] = ABORT_NAME_TABLE;        /* in const.h */
  151.  
  152. extern char *Error_Names[];
  153. char *Error_Names[] = ERROR_NAME_TABLE;        /* in errors.h */
  154.  
  155. extern char *Term_Names[];
  156. char *Term_Names[] = TERM_NAME_TABLE;        /* in errors.h */
  157.  
  158. extern char *Term_Messages[];
  159. char *Term_Messages[] = TERM_MESSAGE_TABLE;    /* in errors.h */
  160.